'use strict';

/**
 * A `Cancel` is an object that is thrown when an operation is canceled.
 *
 * @class
 * @param {string=} message The message.
 */
// 定义了取消配置的对象
function Cancel(message) {
    // 这里的message其实就是调用source.cancel()中的参数
    this.message = message;
}
// 挂载抛出错误的方法
Cancel.prototype.toString = function toString() {
    return 'Cancel' + (this.message ? ': ' + this.message : '');
};
// 将私有变量__CANCEL__ 的值默认设置为true
Cancel.prototype.__CANCEL__ = true;

module.exports = Cancel;